
function func(){
	var d2 = document.getElementById("durationValue");
	var days;
	if(d2.value=="Days_3")days="3 Days";
	if(d2.value=="Days_10")days="10 Days";
	if(d2.value=="Days_30")days="30 Days";
	var d = document.getElementById("duration");
	 var len = d.options.length;
	  for (var i=0;i<len;i++) 
	  {
	   if(d.options[i].text == days)
	   {
	    d.options[i].selected = true;
	   break;
	   }
	  }
		}


function check()   
  {   
	var r = true;
	  var title = document.getElementById("title"); 
	  var isbn = document.getElementById("isbn"); 
	  var description = document.getElementById("description"); 
	  var itemPrice = document.getElementById("itemPrice"); 	 
	  var shippingPrice = document.getElementById("shippingPrice"); 
	  var itemIDStr =  document.getElementById("itemIDStr"); 
	  if(Number(shippingPrice.value)>=Number('4')){
		  alert("the shipping price should be less than 4 dollars");
		  r=false;
	  }
	  if(title.value==""||isbn.value==""||description.value==""||itemPrice.value==""||shippingPrice.value==""||itemPrice.value==""){
		  alert( "you need to fill all the fields"); 
        r=false;
	  }
	  if(r==true){
		  self.location="/seller/updateItem?itemIDStr="+itemIDStr.value+"&title="+title.value+"&isbn="+isbn.value+"&description="+description.value+"&itemPrice="+itemPrice.value +"&shippingPrice="+shippingPrice.value+"&duration="+document.getElementById("duration").value;
	  }
  }

